
package sg.edu.nus.iss.vmcs.store;
/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.io.*;

/**
 * This interface provides the generic functionality required to initialize the stores.
 *
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */
public interface PropertyLoader {
	
	/**
	 * This operation reads the properties file into a {@link java.util.Hashtable hash table}.
	 * @throws IOException
	 */
	public void initialize() throws IOException;	
	
	/**
	 * 
	 * @throws IOException
	 */
	public void saveProperty() throws IOException; 

	/**
	 * This operation returns the number of items (either {@link sg.edu.nus.iss.vmcs.store.CashStoreItem Cash Store Item}s or 
	 * {@link sg.edu.nus.iss.vmcs.store.DrinksStoreItem Drink Store Item}s) stored in the {@link java.util.Hashtable hash table}.
	 * @return Number of items
	 */
	public int getNumOfItems();

	/**
	 * This operation sets the number of items (either {@link sg.edu.nus.iss.vmcs.store.CashStoreItem Cash Store Item}s or 
	 * {@link sg.edu.nus.iss.vmcs.store.DrinksStoreItem Drink Store Item}s) stored in the {@link java.util.Hashtable hash table}.	
	 * @param numItems Number of items
	 */
	public void setNumOfItems(int numItems);

	/**
	 * This operation reads data from the {@link java.util.Hashtable hash table} and creates a {@link sg.edu.nus.iss.vmcs.store.StoreItem StoreItem}.
	 * @param index Zero-based index of the item
	 * @return
	 */
	public StoreItem getItem (int index);

	/**
	 * This operation updates the {@link java.util.Hashtable hash table} with data from the {@link sg.edu.nus.iss.vmcs.store.StoreItem StoreItem}.
	 * @param index Zero-based index
	 * @param item {@link sg.edu.nus.iss.vmcs.store.StoreItem Store Item} to be put in given index
	 */
	public void setItem (int index, StoreItem item);
	
	
}
